package com.talkweb.platform.commonapi.base.entity;

import javax.persistence.Column;

import com.alibaba.fastjson.JSONObject;
import com.talkweb.platform.commonapi.entity.BaseEntity;

import io.swagger.annotations.ApiModelProperty;

/**
 * Json扩展属性实体类
 * 
 * @author lzy
 * @version [版本号, 2017年11月3日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class JsonExtInfo extends BaseEntity
{
    
    /**
     * <属性变量说明>
     * 
     */
    private static final long serialVersionUID = -8272940645192528408L;
    
    @Column(name = "extinfo")
    @ApiModelProperty("扩展信息")
    private JSONObject extInfo;
    
    public JSONObject getExtInfo()
    {
        return extInfo;
    }
    
    public void setExtInfo(JSONObject extInfo)
    {
        this.extInfo = extInfo;
    }
    
    public Object get(Object key)
    {
        return null == this.extInfo ? null : this.extInfo.get(key);
    }
    
    public Object put(String key, Object value)
    {
        if (null == this.extInfo)
        {
            this.extInfo = new JSONObject();
        }
        return this.extInfo.put(key, value);
    }
    
}
